package com.zw.design.pattern.creational.singleton.hungry.enums;

/****
 * 枚举单例模式 是最优雅和最佳的实现
 * 也是线程安全的 可以避免反射攻击的单例
 */
public enum EnumInstance {
    INSTANCE;
    private  Object object;

    public void setObject(Object object) {
        this.object = object;
    }

    public Object getObject() {
        return object;
    }

    public static EnumInstance getInstance(){
        return INSTANCE;
    }
}
